# coding: UTF-8

import os
import math
import json


class account:

    def __init__(self, account):
        self.file = '%s.json' % account
        if os.path.exists(self.file):
            # 载入配置文件
            self.option = json.load(open(self.file, 'r+', encoding='UTF-8'))
        else:
            self.option = {}
            with open(self.file, 'w+', encoding='UTF-8') as f:
                json.dump(item, f, ensure_ascii=False)

    def push(self, income):
        self.balance = self.balance + income
        self.income = self.income + income

    def pop(self, pay):
        self.balance = self.balance - pay
        self.pay = self.pay + pay

    def sync(self, balance):
